/*
 * @Description: 个人工作台
 * @Author: Huang Junjie
 * @Date: 2021-06-04 09:39:31
 * @LastEditTime: 2021-08-05 10:07:29
 * @LastEditors: Liu Zhiwang
 */
import request from '@/utils/request';

// 个人工作台
export function getWorkBench(query) {
  return request({
    url: '/sysm/workBench/',
    method: 'get',
    params: query
  });
}

// 保存
export function updateData(query) {
  return request({
    url: '/sysm/workBench/',
    method: 'POST',
    data: query
  });
}

// 获取应用及其子系统
export function getListPlatformApp(query) {
  return request({
    url: '/sysm/platform/listPlatformApp',
    method: 'GET',
    params: query
  });
}

// 删除应用中心的收藏
export function deleteByMenuId(query) {
  return request({
    url: `/sysm/workBench/deleteByMenuId/${query}`,
    method: 'DELETE'
  });
}

// 通过子系统appId 获取菜单
export function getListTreeByAppId(query) {
  return request({
    url: '/sysm/workBench/findMenuCollectionOrNotByAppId',
    method: 'get',
    params: query
  });
}

// 以下为新工作台收藏子系统接口
// 获取应用及其子系统
export function findAppCollectionOrNot(query) {
  return request({
    url: '/sysm/workBenchApp/findAppCollectionOrNot',
    method: 'GET',
    params: query
  });
}

// 获取工作台列表
export function getWorkBenchApp(query) {
  return request({
    url: '/sysm/workBenchApp/',
    method: 'GET',
    params: query
  });
}

// 工作台收藏
export function updateWorkBenchApp(query) {
  return request({
    url: '/sysm/workBenchApp/',
    method: 'POST',
    data: query
  });
}

// 删除首页工作台收藏
export function deleteWorkBenchApp(query) {
  return request({
    url: `/sysm/workBenchApp/deleteById/${query}`,
    method: 'DELETE'
  });
}

// 删除应用中心取消收藏
export function deleteByAppId(query) {
  return request({
    url: `/sysm/workBenchApp/deleteByAppId/${query}`,
    method: 'DELETE'
  });
}
